package com.xbongbong.sys.model;

import com.xbongbong.paas.toolbox.exception.XbbException;
import com.xbongbong.paas.toolbox.wrap.IModel;
import com.xbongbong.saas.domain.entity.ShareRuleEntity;

import java.util.List;
import java.util.Map;

/**
 * @description: 共享权限规则 Model
 * @Author: leex
 */
public interface ShareRuleModel extends IModel<ShareRuleEntity> {
    Integer insert(ShareRuleEntity entity);

    Integer update(ShareRuleEntity entity) throws XbbException;

    Integer deleteByKey(Long key, String corpid);

    Integer deleteBatch(List<Long> list, String corpid);

    ShareRuleEntity getByKey(Long key, String corpid);

    List<ShareRuleEntity> getByIdIn(List<Long> idIn, String corpid);

    List<ShareRuleEntity> findEntitys(Map<String ,Object>  param);

    Integer getEntitysCount(Map<String ,Object> param);

    Integer getAllRuleCount(String corpid);

    Integer getCountByForm(String corpid, Long formId);

    List<ShareRuleEntity> findByAuthority(String corpid, List<Long> formIdIn, List<String> roleIdIn, List<String> depIdIn, List<String> userIdIn);
}
